package com.nuoniu.sibanyun.mapper.erp;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.erp.ErpProcessRoute;
import com.nuoniu.sibanyun.entity.vo.ErpProcessRouteDetailVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 * 工艺路线 Mapper 接口
 * </p>
 *
 * @author 小啊刚
 * @since 2020-12-30
 */
@Component
@Mapper
public interface ErpProcessRouteMapper extends BaseMapper<ErpProcessRoute> {

    @Select("select * from mab_process_route where company_id=#{companyId} and code=#{code}")
    ErpProcessRoute getByCode(Integer companyId, String code);

    @Select("select * from mab_process_route where company_id=#{companyId} and name=#{name}")
    ErpProcessRoute getByName(Integer companyId, String name);

    @Select("select count(1) from mab_process_route_detail where work_id=#{id}")
    Integer getByWP(Long id);


    List<ErpProcessRouteDetailVo> listErpProcessRouteDetailVo(Integer id);
}
